import request from '@/utils/request'
import request2 from '@/services/baseService'
function getToken() {
  const token = localStorage.getItem('business-token')
  return token
}
export async function selectAllShop(params) {
  return request('/hzsx/productTemplate/selectAllShop', {
    method: 'POST',
    data: params,
    headers: {
      token: getToken()
    }
  })
} //查询所有可关联的店家

export async function updateProductTemplate(params) {
  return request('/hzsx/productTemplate/updateProductTemplate', {
    method: 'POST',
    data: params,
    headers: {
      token: getToken()
    }
  })
} //关联产品

export async function updateProductBindShopId(params) {
  return request('/hzsx/productTemplate/updateProductBindShopId', {
    method: 'POST',
    data: params,
    headers: {
      token: getToken()
    }
  })
} //解绑|修改关联

export async function auditProductTemplate(params) {
    return request('/hzsx/productTemplate/auditProductTemplate', {
      method: 'POST',
      data: params,
      headers: {
        token: getToken()
      }
    })
  } //审核

export async function selectShopRuleAndGiveBackByShopId(params) {
    return request('/hzsx/busShop/selectShopRuleAndGiveBackByShopId', {
      method: 'GET',
      data: params,
      headers: {
        token: getToken()
      }
    })
  } //获取归还地址

export async function selectDistrict(params) {
    return request('/hzsx/district/selectDistrict', {
      method: 'GET',
      data: params,
      headers: {
        token: getToken()
      }
    })
  } //省市区

export async function insertProductTemplateAddress(params) {
    return request('/hzsx/productTemplate/insertProductTemplateAddress', {
      method: 'POST',
      data: params,
      headers: {
        token: getToken()
      }
    })
  } //确认添加商品
// export async function selectBusinessPrdouctTemplate(params) {
//   return request('/hzsx/productTemplate/selectBusinessPrdouctTemplate', {
//     method: 'POST',
//     data: params,
//     headers: {
//       token: getToken()
//     }
//   })
// } //数据接口

export default {
    selectBusinessPrdouctTemplate: data => {
        return request2(`/hzsx/productTemplate/selectBusinessPrdouctTemplate`, data)
    }, 

    insertProductTemplate: data => {
        return request2(`/hzsx/productTemplate/insertProductTemplate`, data)
    },

    deleteProductTemplate: data => {
        return request2(`/hzsx/productTemplate/deleteProductTemplate`, data)
    },
} 